Internal error to see the website in Tut#2

by: prithvirajkadiyala, 8 years ago


I followed all the steps in your tutorial and encountering an error when I go to see my output.
I have tried each and every step as you have done and encountered the same problem time and again.
Help me out with this.





You must be logged in to post. Please login or register an account.



Try running the script via straight python in the console and see if there's a syntax/logic..etc... error in the script itself. That's often the cause of an internal server error for flask/django.

-Harrison 8 years ago

You must be logged in to post. Please login or register an account.


This is my __init__.py

from flask import Flask

app = Flask(__name__)

@app.route('/')
def homepage():
    return "Hi there, how ya doin?"

if __name__ == "__main__":
    app.run()


and this is my FlaskApp.conf

<VirtualHost *:80>
                ServerName 159.203.164.159
                ServerAdmin youemail@email.com
                WSGIScriptAlias / /var/www/FlaskApp/flaskapp.wsgi
                <Directory /var/www/FlaskApp/FlaskApp/>
                        Order allow,deny
                        Allow from all
                </Directory>
                Alias /static /var/www/FlaskApp/FlaskApp/static
                <Directory /var/www/FlaskApp/FlaskApp/static/>
                        Order allow,deny
                        Allow from all
                </Directory>
                ErrorLog ${APACHE_LOG_DIR}/error.log
                LogLevel warn
                CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>






-prithvirajkadiyala 8 years ago

You must be logged in to post. Please login or register an account.


right, so do python __init__.py and see if you get a python error.

-Harrison 8 years ago

You must be logged in to post. Please login or register an account.


I did not get any error there.
It says running on http://127.0.0.1:5000/

-prithvirajkadiyala 8 years ago
Last edited 8 years ago

You must be logged in to post. Please login or register an account.


Strange, okay.

Try:

@app.route('/')
def homepage():
    try:
        return "Hi there, how ya doin?"
    except Exception as e:
        return str(e)


-Harrison 8 years ago

You must be logged in to post. Please login or register an account.


I am still not able to get my website up.
Help me

-prithvirajkadiyala 8 years ago

You must be logged in to post. Please login or register an account.

When visiting the page with the try/except, what's it say?

-Harrison 8 years ago

You must be logged in to post. Please login or register an account.


Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at youemail@email.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Apache/2.4.18 (Ubuntu) Server at 159.203.164.159 Port 80

-prithvirajkadiyala 8 years ago

You must be logged in to post. Please login or register an account.


I have got the website now...
Thanks a lot..
I will ask if here is any other problem in the future

-prithvirajkadiyala 8 years ago

You must be logged in to post. Please login or register an account.